package org.jeecg.modules.chvegetable.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.chvegetable.entity.FlowerTagBook;

import java.util.List;

/**
 * @Description: 采后台账表
 * @Author: jeecg-boot
 * @Date:   2023-02-07
 * @Version: V1.0
 */
public interface FlowerTagBookMapper extends BaseMapper<FlowerTagBook> {

    //入库
    Integer inBooks( @Param("mainID")  String mainID);
    //入库--s删除、撤回
    Integer inBooksBack( @Param("mainID")  String mainID);

    //占用库存
    Integer lockTagnumfroOut( @Param("mainID")  String mainID);

    //占用库存 - 撤销
    Integer lockTagnumfroOutBack( @Param("mainID")  String mainID);

    //查询库存不够的所有花-出库单
    List<FlowerTagBook> getLowBookList(@Param("mainID")  String mainID);

    //查询库存不够的所有花--预出库
    List<FlowerTagBook> getLowBookListPre(@Param("mainID")  String mainID);

    //出库 扣减库存
    Integer outForOutOrder( @Param("mainID")  String mainID);

    //出库 扣减库存--撤销
    Integer outForOutOrderBack( @Param("mainID")  String mainID);

    //预出库 扣减库存
    Integer outForOutOrderPre( @Param("mainID")  String mainID);

    //预出库 扣减库存--撤销
    Integer outForOutOrderPreBack( @Param("mainID")  String mainID);


    //校验台账数据
    Integer checkBooksIsErr();

    //获取台账合计
    FlowerTagBook getTotal(@Param("ew") Wrapper<FlowerTagBook> wrapper);
}
